<template>
  <Table :tableData="tableData" max-height="500px"
         border
         :headerStyle="{backgroundColor:'#fffbed'}" :table-column="tableColumn" :page="false">

    <template slot="transferType" slot-scope="{row}">
      {{ row.transferType === 1 ? $t('线下') : $t('线上') }}
    </template>
  </Table>
</template>

<script>
import {refundDetail} from "@/api/finance";

export default {
  name: "repaymenutDetails",
  props:['routesQuery'],
  data() {
    return {
      tableData: [],
      tableColumn: [
        {label: this.$t('到账时间'), prop: 'actualRefundTimestamp', align: 'center', minWidth: 150},
        {label: this.$t('还款金额'), prop: 'actualRefundAmount', align: 'center', minWidth: 100},
        {label: this.$t('还款类型'), prop: 'transferType', slot: 'transferType', align: 'center', minWidth: 100},
        {label: this.$t('还款渠道'), prop: 'channelCode', align: 'center', minWidth: 100},
        {label: this.$t('操作人'), prop: 'inputUserId', align: 'center', minWidth: 100},
        {label: this.$t('操作时间'), prop: 'inputTimestamp', align: 'center', minWidth: 150},
      ]
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    async getList() {
      const {orderId} = this.routesQuery
      const res = await refundDetail({
        loanRecordId: orderId
      })
      if (res.code === 1) {
        this.tableData = res.data
      }
    }
  }
}
</script>

<style scoped>

</style>
